<!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
-->

<%@ page contentType="text/html;charset=UTF-8" %>

<html>
  <head>
    <meta name="layout" content="mobile">
    <title>${facility.name} Groups</title>
  </head>
            <h2>${facility.name} Groups</h2>
            <table>
              <g:each var="name" in="${facilityGroupNames}">
                <tr>
                  <td align="right">
                    <g:form controller="facilityGroup" action="view">
                      <g:hiddenField name="name" value="${name}"/>
                      <g:hiddenField name="facilityName" value="${facility.name}"/>
                      <g:submitButton name="submit" value="${name}"/>
                    </g:form>
                  </td>
                  <td style="padding-left: 10px">
                    <g:form action="removeGroup">
                      <g:hiddenField name="name" value="${facility.name}"/>
                      <g:hiddenField name="groupName" value="${name}"/>
                      <g:submitButton name="submit" data-icon="delete" data-iconpos="notext"/>
                    </g:form>
                  </td>
                </tr>
              </g:each>
            </table>
            <br /><br />
            <g:form action="view">
              <g:hiddenField name="name" value="${facility.name}"/>
              <g:submitButton name="submit" value="Facility" data-icon="back"/>
            </g:form>
            </br>

            <h2 align="left">Other Groups</h2>
            <table align="left">
              <g:each var="name" in="${groupNames}">
                <tr>
                  <td align="right">
                    <g:form controller="facilityGroup" action="view">
                      <g:hiddenField name="name" value="${name}"/>
                      <g:hiddenField name="facilityName" value="${facility.name}"/>
                      <g:submitButton name="submit" value="${name}"/>
                    </g:form>
                  </td>
                  <td style="padding-left: 10px">
                    <g:form action="addGroup">
                      <g:hiddenField name="name" value="${facility.name}"/>
                      <g:hiddenField name="groupName" value="${name}"/>
                      <g:submitButton name="submit" data-icon="plus" data-iconpos="notext"/>
                    </g:form>
                  </td>
                </tr>
              </g:each>
            </table>
            <br /><br /><br /><br /><br /><br />
            <g:form controller="facilityGroup" action="createNew">
              <g:hiddenField name="name" value="${facility.name}"/>
              <g:submitButton name="submit" value="New Group"/>
            </g:form> 
  </body>
</html>
